<script type="text/javascript">
    $(function() {
        $("#theTable tr:even").addClass("stripe1");
        $("#theTable tr:odd").addClass("stripe2");
        $("#theTable tr").hover(
        function() {
            $(this).toggleClass("highlight");
        },
        function() {
            $(this).toggleClass("highlight");
        }
    );
    });

    function deleteRow(ID) {
        var id	= ID;
        var pilih = confirm('Data yang akan dihapus  = '+id+ '?');
        if (pilih==true) {
            $.ajax({
                type	: "POST",
                url	: "modul/tahunajaran/hapus.php",
                data	: "id=" + id,
                success	: function(data){
                    $("#tampil_data").load("modul/tahunajaran/tampil_data.php");
                    pesanInfo(data);
                }
            });
        }
    }
</script>
<?php
// www.contoh-ta.com
//author : asep setiawan & Team
include '../../inc/inc.koneksi.php';
//ini_set('display_errors', 1); ini_set('error_reporting', E_ERROR);

echo "<table id='theTable' width='100%'>
        <tr>
                <th width='5%'>No</th>
                <th>Nama Tahun Ajaran</th>
                <th>Status</th>
                <th width='10%'>Aksi</th>
        </tr>";
$sql = "SELECT * FROM tahunajaran ORDER BY id_tahunajaran";
$query = mysql_query($sql);

$no = 1;
while ($rows = mysql_fetch_array($query)) {
    echo "<tr>
                <td align='center'>$no</td>
                <td>{$rows['nama_tahunajaran']}</td>
                <td align='center'><a href='#' onclick='persiapanUbahHapus(\"{$rows['id_tahunajaran']}\", \"{$rows['status_tahunajaran']}\", false)'>" . ($rows['status_tahunajaran'] == '1' ? 'Aktif' : 'NonAktif') . "</a></td>

                <td align='center'>
                <a href='#' onclick='persiapanUbahHapus(\"{$rows['id_tahunajaran']}\", \"{$rows['status_tahunajaran']}\", true)'>Hapus</a>			
                </td>
        </tr>";
    $no++;
}
echo "</table>";
?>